#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>
int F(int x, int d)
{
	d--;
	if (x > 10)
		return (x % 10 * pow(10, d) + F(x / 10, d));
	else
		return x;
}
int main()
{
	int a = 0; int n = 0; int r = 0;
	scanf("%d", &a);
	r = a;
	while (a > 0)
	{
		a = a / 10;
		n++;
	}
	int ret = F(r, n);
	printf("%d", ret);
	return 0;
}